<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对话框</title>
    <style>
        body {
            margin: 0;
        }

        .dialog {
            position: fixed;
            height: 300px;
            width: 500px;
            background-color: white;

            top: 200px;

            /*居中*/
            /*left: 50%;*/
            /*margin-left:-250px ;*/

            /*居中*/
            left: 0;
            right: 0;
            margin: 0 auto;

            z-index: 1000;
        }

        .mask {
            background-color: black;
            position: fixed;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            opacity: 0.7;
            z-index: 999;
        }
    </style>
</head>
<body>
<div style="height: 1000px;background-color: #5f5750">~~~这可能是个页面~~~</div>
<div class="dialog"></div>
<div class="mask"></div>
</body>
</html>